package com.itheima.common.constants;

/**
 * Redis Key 常量
 * 统一管理所有 Redis Key 前缀和名称
 * 
 * @author itheima
 */
public class RedisConstants {

    /**
     * 审核系统 - 延迟队列相关
     */
    public static class AuditQueue {
        /** 延迟队列（ZSet，按执行时间排序） */
        public static final String DELAY_QUEUE_AUDIT_TASKS = "delay:queue:audit:tasks";
        
        /** 就绪队列（List，FIFO） */
        public static final String READY_QUEUE_AUDIT_TASKS = "ready:queue:audit:tasks";
        
        /** 处理中集合（Set，防重复） */
        public static final String PROCESSING_AUDIT_TASKS = "processing:audit:tasks";
        
        /** 任务状态缓存（Hash，taskId -> status） */
        public static final String TASK_STATUS_CACHE = "task:status:cache";
    }

    /**
     * 审核系统 - 分布式锁
     */
    public static class AuditLock {
        /** 扫描延迟队列锁 */
        public static final String LOCK_SCAN_DELAY_QUEUE = "lock:scan:delay:queue";
        
        /** 消费就绪队列锁 */
        public static final String LOCK_CONSUME_READY_QUEUE = "lock:consume:ready:queue";
    }

    /**
     * 排行榜 - 实时排行榜（Kafka Streams 计算）
     */
    public static class RealtimeRanking {
        /** 实时热度排行榜（近期热度，适合发现新热点） */
        public static final String BOOK_REALTIME_HOT_RANKING = "ranking:book:realtime:hot";
        
        /** 实时阅读排行榜 */
        public static final String BOOK_REALTIME_READ_RANKING = "ranking:book:realtime:read";
        
        /** 实时收藏排行榜 */
        public static final String BOOK_REALTIME_COLLECT_RANKING = "ranking:book:realtime:collect";
        
        /** 实时点赞排行榜 */
        public static final String BOOK_REALTIME_LIKE_RANKING = "ranking:book:realtime:like";
        
        /** 实时热门笔记排行榜 */
        public static final String NOTE_REALTIME_HOT_RANKING = "ranking:note:realtime:hot";
        
        /** 实时热门书评排行榜 */
        public static final String REVIEW_REALTIME_HOT_RANKING = "ranking:review:realtime:hot";
    }

    /**
     * 排行榜 - 综合排行榜（定时任务计算，带时间衰减）
     */
    public static class ComprehensiveRanking {
        /** 综合热度排行榜（历史累积+时间衰减，适合发现经典热门） */
        public static final String BOOK_HOT_RANKING = "ranking:book:hot";
        
        /** 图书阅读排行榜（总阅读人数） */
        public static final String BOOK_READ_RANKING = "ranking:book:read";
        
        /** 图书收藏排行榜（总收藏数） */
        public static final String BOOK_COLLECT_RANKING = "ranking:book:collect";
        
        /** 图书点赞排行榜（总点赞数） */
        public static final String BOOK_LIKE_RANKING = "ranking:book:like";
        
        /** 综合热门笔记排行榜 */
        public static final String NOTE_HOT_RANKING = "ranking:note:hot";
        
        /** 笔记点赞排行榜 */
        public static final String NOTE_LIKE_RANKING = "ranking:note:like";
        
        /** 笔记收藏排行榜 */
        public static final String NOTE_COLLECT_RANKING = "ranking:note:collect";
        
        /** 综合热门书评排行榜 */
        public static final String REVIEW_HOT_RANKING = "ranking:review:hot";
        
        /** 书评点赞排行榜 */
        public static final String REVIEW_LIKE_RANKING = "ranking:review:like";
        
        /** 书评收藏排行榜 */
        public static final String REVIEW_COLLECT_RANKING = "ranking:review:collect";
    }

    /**
     * 排行榜 - 时间段排行榜
     */
    public static class TimeBasedRanking {
        /** 今日热度榜 */
        public static final String BOOK_TODAY_HOT_RANKING = "ranking:book:today:hot";
        
        /** 本周热度榜 */
        public static final String BOOK_WEEK_HOT_RANKING = "ranking:book:week:hot";
        
        /** 本月热度榜 */
        public static final String BOOK_MONTH_HOT_RANKING = "ranking:book:month:hot";
    }

    /**
     * 排行榜 - 用户排行榜
     */
    public static class UserRanking {
        /** 用户阅读时长排行榜 */
        public static final String USER_READING_TIME_RANKING = "ranking:user:reading_time";
        
        /** 用户活跃度排行榜 */
        public static final String USER_ACTIVE_RANKING = "ranking:user:active";
    }
}

